package com.bsoft.gol.hcs.clinical.entity;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "account",  catalog = "")
public class Account {
    private long id;
    private byte utype;
    private String username;
    private String password;
    private String token;
    private String mobile;
    private String realname;
    private String email;
    private Byte sexcode;
    private Timestamp birthdate;
    private String header;
    private Byte flag;
    private Byte failurenum;
    private Timestamp lastlogdate;
    private String lastlogip;
    private String regip;
    private Timestamp regdate;
    private Short regtype;
    private String cardtype;
    private String idcard;
    private Short activated;
    private String openid;
    private Byte nationality;
    private String patientcode;
    private String province;
    private String provinceCode;
    private String city;
    private String cityCode;
    private String area;
    private String areaCode;
    private String address;
    private String certificationValidityPeriod;
    private String aliuid;
    private Timestamp lastPasswordDate;
    private Timestamp lastOperateDate;
    private String guardianName;
    private Integer guardianCardType;
    private String guardianCardNum;
    private String guardianPhone;
    private String reasonsForCancellation;
    private String miniOpenid;
    private String onlineStatus;
    private Timestamp onlineStatusUpdateTime;

    @Id
    @Column(name = "ID")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "UTYPE")
    public byte getUtype() {
        return utype;
    }

    public void setUtype(byte utype) {
        this.utype = utype;
    }

    @Basic
    @Column(name = "USERNAME")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "PASSWORD")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "TOKEN")
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Basic
    @Column(name = "MOBILE")
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "REALNAME")
    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    @Basic
    @Column(name = "EMAIL")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "SEXCODE")
    public Byte getSexcode() {
        return sexcode;
    }

    public void setSexcode(Byte sexcode) {
        this.sexcode = sexcode;
    }

    @Basic
    @Column(name = "BIRTHDATE")
    public Timestamp getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Timestamp birthdate) {
        this.birthdate = birthdate;
    }

    @Basic
    @Column(name = "HEADER")
    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    @Basic
    @Column(name = "FLAG")
    public Byte getFlag() {
        return flag;
    }

    public void setFlag(Byte flag) {
        this.flag = flag;
    }

    @Basic
    @Column(name = "FAILURENUM")
    public Byte getFailurenum() {
        return failurenum;
    }

    public void setFailurenum(Byte failurenum) {
        this.failurenum = failurenum;
    }

    @Basic
    @Column(name = "LASTLOGDATE")
    public Timestamp getLastlogdate() {
        return lastlogdate;
    }

    public void setLastlogdate(Timestamp lastlogdate) {
        this.lastlogdate = lastlogdate;
    }

    @Basic
    @Column(name = "LASTLOGIP")
    public String getLastlogip() {
        return lastlogip;
    }

    public void setLastlogip(String lastlogip) {
        this.lastlogip = lastlogip;
    }

    @Basic
    @Column(name = "REGIP")
    public String getRegip() {
        return regip;
    }

    public void setRegip(String regip) {
        this.regip = regip;
    }

    @Basic
    @Column(name = "REGDATE")
    public Timestamp getRegdate() {
        return regdate;
    }

    public void setRegdate(Timestamp regdate) {
        this.regdate = regdate;
    }

    @Basic
    @Column(name = "REGTYPE")
    public Short getRegtype() {
        return regtype;
    }

    public void setRegtype(Short regtype) {
        this.regtype = regtype;
    }

    @Basic
    @Column(name = "CARDTYPE")
    public String getCardtype() {
        return cardtype;
    }

    public void setCardtype(String cardtype) {
        this.cardtype = cardtype;
    }

    @Basic
    @Column(name = "IDCARD")
    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    @Basic
    @Column(name = "ACTIVATED")
    public Short getActivated() {
        return activated;
    }

    public void setActivated(Short activated) {
        this.activated = activated;
    }

    @Basic
    @Column(name = "OPENID")
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "NATIONALITY")
    public Byte getNationality() {
        return nationality;
    }

    public void setNationality(Byte nationality) {
        this.nationality = nationality;
    }

    @Basic
    @Column(name = "PATIENTCODE")
    public String getPatientcode() {
        return patientcode;
    }

    public void setPatientcode(String patientcode) {
        this.patientcode = patientcode;
    }

    @Basic
    @Column(name = "PROVINCE")
    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    @Basic
    @Column(name = "PROVINCE_CODE")
    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    @Basic
    @Column(name = "CITY")
    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Basic
    @Column(name = "CITY_CODE")
    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    @Basic
    @Column(name = "AREA")
    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    @Basic
    @Column(name = "AREA_CODE")
    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    @Basic
    @Column(name = "ADDRESS")
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "certification_validity_period")
    public String getCertificationValidityPeriod() {
        return certificationValidityPeriod;
    }

    public void setCertificationValidityPeriod(String certificationValidityPeriod) {
        this.certificationValidityPeriod = certificationValidityPeriod;
    }

    @Basic
    @Column(name = "aliuid")
    public String getAliuid() {
        return aliuid;
    }

    public void setAliuid(String aliuid) {
        this.aliuid = aliuid;
    }

    @Basic
    @Column(name = "last_password_date")
    public Timestamp getLastPasswordDate() {
        return lastPasswordDate;
    }

    public void setLastPasswordDate(Timestamp lastPasswordDate) {
        this.lastPasswordDate = lastPasswordDate;
    }

    @Basic
    @Column(name = "last_operate_date")
    public Timestamp getLastOperateDate() {
        return lastOperateDate;
    }

    public void setLastOperateDate(Timestamp lastOperateDate) {
        this.lastOperateDate = lastOperateDate;
    }

    @Basic
    @Column(name = "guardian_name")
    public String getGuardianName() {
        return guardianName;
    }

    public void setGuardianName(String guardianName) {
        this.guardianName = guardianName;
    }

    @Basic
    @Column(name = "guardian_card_type")
    public Integer getGuardianCardType() {
        return guardianCardType;
    }

    public void setGuardianCardType(Integer guardianCardType) {
        this.guardianCardType = guardianCardType;
    }

    @Basic
    @Column(name = "guardian_card_num")
    public String getGuardianCardNum() {
        return guardianCardNum;
    }

    public void setGuardianCardNum(String guardianCardNum) {
        this.guardianCardNum = guardianCardNum;
    }

    @Basic
    @Column(name = "guardian_phone")
    public String getGuardianPhone() {
        return guardianPhone;
    }

    public void setGuardianPhone(String guardianPhone) {
        this.guardianPhone = guardianPhone;
    }

    @Basic
    @Column(name = "reasons_for_cancellation")
    public String getReasonsForCancellation() {
        return reasonsForCancellation;
    }

    public void setReasonsForCancellation(String reasonsForCancellation) {
        this.reasonsForCancellation = reasonsForCancellation;
    }

    @Basic
    @Column(name = "mini_openid")
    public String getMiniOpenid() {
        return miniOpenid;
    }

    public void setMiniOpenid(String miniOpenid) {
        this.miniOpenid = miniOpenid;
    }

    @Basic
    @Column(name = "online_status")
    public String getOnlineStatus() {
        return onlineStatus;
    }

    public void setOnlineStatus(String onlineStatus) {
        this.onlineStatus = onlineStatus;
    }

    @Basic
    @Column(name = "online_status_update_time")
    public Timestamp getOnlineStatusUpdateTime() {
        return onlineStatusUpdateTime;
    }

    public void setOnlineStatusUpdateTime(Timestamp onlineStatusUpdateTime) {
        this.onlineStatusUpdateTime = onlineStatusUpdateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Account account = (Account) o;

        if (id != account.id) {
            return false;
        }
        if (utype != account.utype) {
            return false;
        }
        if (username != null ? !username.equals(account.username) : account.username != null) {
            return false;
        }
        if (password != null ? !password.equals(account.password) : account.password != null) {
            return false;
        }
        if (token != null ? !token.equals(account.token) : account.token != null) {
            return false;
        }
        if (mobile != null ? !mobile.equals(account.mobile) : account.mobile != null) {
            return false;
        }
        if (realname != null ? !realname.equals(account.realname) : account.realname != null) {
            return false;
        }
        if (email != null ? !email.equals(account.email) : account.email != null) {
            return false;
        }
        if (sexcode != null ? !sexcode.equals(account.sexcode) : account.sexcode != null) {
            return false;
        }
        if (birthdate != null ? !birthdate.equals(account.birthdate) : account.birthdate != null) {
            return false;
        }
        if (header != null ? !header.equals(account.header) : account.header != null) {
            return false;
        }
        if (flag != null ? !flag.equals(account.flag) : account.flag != null) {
            return false;
        }
        if (failurenum != null ? !failurenum.equals(account.failurenum) : account.failurenum != null) {
            return false;
        }
        if (lastlogdate != null ? !lastlogdate.equals(account.lastlogdate) : account.lastlogdate != null) {
            return false;
        }
        if (lastlogip != null ? !lastlogip.equals(account.lastlogip) : account.lastlogip != null) {
            return false;
        }
        if (regip != null ? !regip.equals(account.regip) : account.regip != null) {
            return false;
        }
        if (regdate != null ? !regdate.equals(account.regdate) : account.regdate != null) {
            return false;
        }
        if (regtype != null ? !regtype.equals(account.regtype) : account.regtype != null) {
            return false;
        }
        if (cardtype != null ? !cardtype.equals(account.cardtype) : account.cardtype != null) {
            return false;
        }
        if (idcard != null ? !idcard.equals(account.idcard) : account.idcard != null) {
            return false;
        }
        if (activated != null ? !activated.equals(account.activated) : account.activated != null) {
            return false;
        }
        if (openid != null ? !openid.equals(account.openid) : account.openid != null) {
            return false;
        }
        if (nationality != null ? !nationality.equals(account.nationality) : account.nationality != null) {
            return false;
        }
        if (patientcode != null ? !patientcode.equals(account.patientcode) : account.patientcode != null) {
            return false;
        }
        if (province != null ? !province.equals(account.province) : account.province != null) {
            return false;
        }
        if (provinceCode != null ? !provinceCode.equals(account.provinceCode) : account.provinceCode != null) {
            return false;
        }
        if (city != null ? !city.equals(account.city) : account.city != null) {
            return false;
        }
        if (cityCode != null ? !cityCode.equals(account.cityCode) : account.cityCode != null) {
            return false;
        }
        if (area != null ? !area.equals(account.area) : account.area != null) {
            return false;
        }
        if (areaCode != null ? !areaCode.equals(account.areaCode) : account.areaCode != null) {
            return false;
        }
        if (address != null ? !address.equals(account.address) : account.address != null) {
            return false;
        }
        if (certificationValidityPeriod != null ? !certificationValidityPeriod.equals(account.certificationValidityPeriod) : account.certificationValidityPeriod != null) {
            return false;
        }
        if (aliuid != null ? !aliuid.equals(account.aliuid) : account.aliuid != null) {
            return false;
        }
        if (lastPasswordDate != null ? !lastPasswordDate.equals(account.lastPasswordDate) : account.lastPasswordDate != null) {
            return false;
        }
        if (lastOperateDate != null ? !lastOperateDate.equals(account.lastOperateDate) : account.lastOperateDate != null) {
            return false;
        }
        if (guardianName != null ? !guardianName.equals(account.guardianName) : account.guardianName != null) {
            return false;
        }
        if (guardianCardType != null ? !guardianCardType.equals(account.guardianCardType) : account.guardianCardType != null) {
            return false;
        }
        if (guardianCardNum != null ? !guardianCardNum.equals(account.guardianCardNum) : account.guardianCardNum != null) {
            return false;
        }
        if (guardianPhone != null ? !guardianPhone.equals(account.guardianPhone) : account.guardianPhone != null) {
            return false;
        }
        if (reasonsForCancellation != null ? !reasonsForCancellation.equals(account.reasonsForCancellation) : account.reasonsForCancellation != null) {
            return false;
        }
        if (miniOpenid != null ? !miniOpenid.equals(account.miniOpenid) : account.miniOpenid != null) {
            return false;
        }
        if (onlineStatus != null ? !onlineStatus.equals(account.onlineStatus) : account.onlineStatus != null) {
            return false;
        }
        if (onlineStatusUpdateTime != null ? !onlineStatusUpdateTime.equals(account.onlineStatusUpdateTime) : account.onlineStatusUpdateTime != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (int) utype;
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (token != null ? token.hashCode() : 0);
        result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
        result = 31 * result + (realname != null ? realname.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (sexcode != null ? sexcode.hashCode() : 0);
        result = 31 * result + (birthdate != null ? birthdate.hashCode() : 0);
        result = 31 * result + (header != null ? header.hashCode() : 0);
        result = 31 * result + (flag != null ? flag.hashCode() : 0);
        result = 31 * result + (failurenum != null ? failurenum.hashCode() : 0);
        result = 31 * result + (lastlogdate != null ? lastlogdate.hashCode() : 0);
        result = 31 * result + (lastlogip != null ? lastlogip.hashCode() : 0);
        result = 31 * result + (regip != null ? regip.hashCode() : 0);
        result = 31 * result + (regdate != null ? regdate.hashCode() : 0);
        result = 31 * result + (regtype != null ? regtype.hashCode() : 0);
        result = 31 * result + (cardtype != null ? cardtype.hashCode() : 0);
        result = 31 * result + (idcard != null ? idcard.hashCode() : 0);
        result = 31 * result + (activated != null ? activated.hashCode() : 0);
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (nationality != null ? nationality.hashCode() : 0);
        result = 31 * result + (patientcode != null ? patientcode.hashCode() : 0);
        result = 31 * result + (province != null ? province.hashCode() : 0);
        result = 31 * result + (provinceCode != null ? provinceCode.hashCode() : 0);
        result = 31 * result + (city != null ? city.hashCode() : 0);
        result = 31 * result + (cityCode != null ? cityCode.hashCode() : 0);
        result = 31 * result + (area != null ? area.hashCode() : 0);
        result = 31 * result + (areaCode != null ? areaCode.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (certificationValidityPeriod != null ? certificationValidityPeriod.hashCode() : 0);
        result = 31 * result + (aliuid != null ? aliuid.hashCode() : 0);
        result = 31 * result + (lastPasswordDate != null ? lastPasswordDate.hashCode() : 0);
        result = 31 * result + (lastOperateDate != null ? lastOperateDate.hashCode() : 0);
        result = 31 * result + (guardianName != null ? guardianName.hashCode() : 0);
        result = 31 * result + (guardianCardType != null ? guardianCardType.hashCode() : 0);
        result = 31 * result + (guardianCardNum != null ? guardianCardNum.hashCode() : 0);
        result = 31 * result + (guardianPhone != null ? guardianPhone.hashCode() : 0);
        result = 31 * result + (reasonsForCancellation != null ? reasonsForCancellation.hashCode() : 0);
        result = 31 * result + (miniOpenid != null ? miniOpenid.hashCode() : 0);
        result = 31 * result + (onlineStatus != null ? onlineStatus.hashCode() : 0);
        result = 31 * result + (onlineStatusUpdateTime != null ? onlineStatusUpdateTime.hashCode() : 0);
        return result;
    }
}
